package com.websuites.core.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringContextHelper implements ApplicationContextAware
{           
	private static ApplicationContext context ;          
	
	@Override    
	public void setApplicationContext(ApplicationContext context) throws BeansException 
	{        
		SpringContextHelper.context = context;         
		System.out.println("spring context:"+SpringContextHelper.context);    
	}   
	
	public static Object getBean(String beanName)
	{        
		return context.getBean(beanName);     
	} 
}
